﻿function Get_Loading() {
    if (document.getElementById("loading").style.display == "") {
        return;
    }
    document.getElementById("load").style.display = "";
};

function Set_UnLoading() {
    try {
        if (document.getElementById("MainFrame").style.display == "none") {
            document.getElementById("MainFrame").style.display = "";
        };
        setTimeout(function () {
            document.getElementById("load").style.display = "none";
        }, 3000);
    } catch (e) { }
};
function LogoutSystem() {
    if (top.LogoutConfirmDialog === undefined) {
        var startColor = "#B2CCDF";
        var endColor = "#B1BBCF";
        var borderColor = "#97ccd9";
        if (window.SystemSkinName == "MSN_Blue") {
            startColor = "#F0FEEF";
            endColor = "#C2FFD0";
            borderColor = "#C0FFD0";
        };
        top.LogoutConfirmDialog = new Window({
            width: 180, height: 100, modal: true, closeTip: '取消退出', html: '<table oncontextmenu="return false" style="background-color: #ffffff; width:100%; height: 100%; text-align: center; font-size: 12px;"><tr height="40"><td colspan="2">是否要退出系统?</td></tr><tr><td align="right">' + '<input title="确认退出" type="button" style="filter: progid:dximagetransform.microsoft.gradient(gradienttype=0, startcolorstr=' + startColor + ', endcolorstr=' + endColor + ');border: 1px solid ' + borderColor + ';height: 18px; width: 50px;cursor: pointer;" onclick="top.location.replace(\'/MainAspx/Login.aspx?Login_Out=1\');" value="是">&nbsp;</td><td align="left">&nbsp;' + '<input title="取消退出" type="button" tab="0" style="filter: progid:dximagetransform.microsoft.gradient(gradienttype=0, startcolorstr=' + startColor + ', endcolorstr=' + endColor + ');border: 1px solid ' + borderColor + ';height: 18px; width: 50px;cursor: pointer;" onclick="top.LogoutConfirmDialog.close();" value="否"></td></tr></table></div>', caption: '注销提示'
        });
    };
    top.LogoutConfirmDialog.setVisible(true);
};

function RemoveMenuMasker(sender, e) {
    var iframe = sender.GetMenuIFrameElement(e.item.indexPath);
    if (iframe) {
        iframe.style.display = "none";
    }
};

function AddMenuMasker(sender, e) {
    var iframe = sender.GetMenuIFrameElement(e.item.indexPath);
    var el = sender.GetMenuElement(e.item.indexPath);
    if (!iframe) {
        var iframeId = sender.name + "_DXMIF" + sender.GetMenuLevel(e.item.indexPath);
        iframe = document.getElementById(iframeId);
        if (!iframe) {
            iframe = document.createElement("iframe");
            with (iframe) {
                scrolling = "no";
                frameBorder = "0";
                style.filter = "Alpha(Opacity=0)";
                id = iframeId;
            }; document.body.appendChild(iframe);
        }
    };
    if (iframe) {
        with (iframe.style) {
            display = "";
            zIndex = el.style.zIndex - 1;
            height = parseInt(el.style.height) - 4;
            width = parseInt(el.style.width) - 4;
            top = el.style.top;
            left = el.style.left;
            position = el.style.position;
        }
    }
};

function MenuNavToggle(menu, control) {
    var menuFrame = document.getElementById("ifr_left");
    if (menuFrame.toggling) {
        return;
    };
    menuFrame.toggling = true;
    var visible = menu.style.display == "";
    control.src = "../App_Themes/" + top.SystemSkinName + "/Images/img_menu_" + (visible ? "close" : "open") + "_over.gif";
    control.title = visible ? "显示菜单" : "隐藏菜单"; if (!menuFrame.src && !visible) {
        menuFrame.src = "Left_Menu.aspx?" + top.SystemSkinName;
        menuFrame.visible = visible ? "none" : "";
        menuFrame.menu = menu; return;
    };
    menu.style.display = visible ? "none" : "";
    menuFrame.toggling = false;
};

function TopBarToggle(bar, control) {
    var visible = bar.style.display == "";
    control.src = "../App_Themes/" + top.SystemSkinName + "/Images/img_dingye_" + (visible ? "close" : "open") + "_over.gif";
    control.title = visible ? "显示顶栏" : "隐藏顶栏";
    bar.style.display = visible ? "none" : "";
}